package com.yongbao.model.util;

import com.yongbao.model.dtomapper.RoleDtoMapper;
import com.yongbao.model.domain.RoleDO;
import com.yongbao.model.vo.RoleVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class RoleConvert {

    public static List<RoleVO> buildRoleVoList(List<RoleDO> roleDOList) {
        if (CollectionUtils.isEmpty(roleDOList)) {
            return Lists.newArrayList();
        }
        List<RoleVO> roleVOList = new ArrayList<>();
        for (RoleDO roleDO : roleDOList) {
            roleVOList.add(RoleDtoMapper.INSTANCE.do2VO(roleDO));
        }

        return roleVOList;
    }
}
